#ifndef X_7_H
#define X_7_H

#include "common.h"

// Instance
template <AllegroVersion version>
struct x07
{
    uint32_t t;
    uint32_t k;
    uint32_t un1; // Points to another instance
    
    uint32_t ptr1; // 0x2D
    
    uint32_t un5;
    
    uint32_t refdes_string_ref;
    
    uint32_t ptr2;
    
    uint32_t ptr3; // x03 or null
    
    uint32_t un3; // Always null?
    
    uint32_t ptr4; // x32 or null
    
    uint32_t TAIL;
    operator x07<A_174>() const;
    static constexpr AllegroVersion versions[1] = {A_172};
};

#if __cplusplus >= 202002L
template <AllegroVersion version> requires(version >= A_172)
struct x07<version>
{
    uint32_t t;
    uint32_t k;
    uint32_t un1; // Points to another instance

    uint32_t ptr0;
    uint32_t un4;
    uint32_t un2;

    uint32_t ptr1; // 0x2D

    uint32_t refdes_string_ref;

    uint32_t ptr2;

    uint32_t ptr3; // x03 or null

    uint32_t un3; // Always null?

    uint32_t ptr4; // x32 or null

    uint32_t TAIL;
    operator x07<A_174>() const;
    static constexpr AllegroVersion versions[1] = {A_172};
};
#else
template <> struct x07<A_172>
{
    uint32_t t;
    uint32_t k;
    uint32_t un1; // Points to another instance

    uint32_t ptr0;
    uint32_t un4;
    uint32_t un2;

    uint32_t ptr1; // 0x2D

    uint32_t refdes_string_ref;

    uint32_t ptr2;

    uint32_t ptr3; // x03 or null

    uint32_t un3; // Always null?

    uint32_t ptr4; // x32 or null

    uint32_t TAIL;
    operator x07<A_174>() const;
    static constexpr AllegroVersion versions[1] = {A_172};
};
template <> struct x07<A_174> : x07<A_172> {};
#endif

static_assert(sizeof_until_tail<x07<A_172>>() == 48);
static_assert(sizeof_until_tail<x07<A_174>>() == 48);

#endif // X_7_H
